import request from "@/utils/request";

enum API {
    dealFlow_URL = "/itp/api/realDeal/",
    accountPosition_URL = "/itp/api/account/position",
    resource_URL = "/itp/data/perm/source",
    interestRate_URL="/itp/api/interestRate",
    stockPoolType_URL="/itp/api/stockPool",
    controlPool_URL="/itp/api/controlPool"
} 
export default{
    getDealFlowAllot: (param: any) => request.post(`${API.dealFlow_URL}page`, param),
    matchDealFlowAllot:(param:any)=>request.post(`${API.dealFlow_URL}match`,param),
    unbindMatchDfAllot:(param:any)=>request.post(`${API.dealFlow_URL}unbindMatch`,param),
    updateMatchDfAllot:(param:any)=>request.post(`${API.dealFlow_URL}updateMatch`,param),
    addAccPosition:(param:any)=>request.post(`${API.accountPosition_URL}`,param),//新增
    putAccPosition:(param:any)=>request.put(`${API.accountPosition_URL}`,param),//修改
    allAcc:(param:any)=>request.post(`${API.accountPosition_URL}/all`,param),//所有持仓账户
    getAccPositionInfo:(id:number)=>request.get(`${API.accountPosition_URL}/id?id=${id}`),//详情
    delAccPosition:(id:number)=>request.delete(`${API.accountPosition_URL}?id=${id}`),//删除
    editAccFlags:(param:any)=>request.post(`${API.accountPosition_URL}/save/flags`,param),//修改账户标识
    postRecheck:(id:number)=>request.post(`${API.accountPosition_URL}/flag/recheck/${id}`),//复核
    putAccPositionMove:(param:any)=>request.put(`${API.accountPosition_URL}/move`,param),//拖动

    getPermSourceViewPage: (current: number, size: number, data: any) => request.post(`${API.resource_URL}/view/page?current=${current}&size=${size}`, data),
    getPermSourceViewDetail: (id: number) => request.get(`${API.resource_URL}/view/detail?id=${id}`),
    deletePermSourceView: (id: number) => request.get(`${API.resource_URL}/view/delete?id=${id}`),
    savePermSourceView: (data: any) => request.post(`${API.resource_URL}/view/save`, data),

    getPermSourceExpFind: (id: number) => request.get(`${API.resource_URL}/exp/find/list?sourceId=${id}`),

    getPermSourceViewFindParam: (id: number) => request.get(`${API.resource_URL}/view/find/param?viewId=${id}`),
    getPermSourceViewDataPage: (current: number, size: number, data: any) => request.post(`${API.resource_URL}/view/data/page?current=${current}&size=${size}`, data),
    exportPermSourceViewData: (data: any) => request.exportFile(`${API.resource_URL}/view/data/export`, data),

    getPermSourceExpList: (id: number) => request.get(`${API.resource_URL}/exp/find/list?sourceId=${id}`),
    savePermSourceExpBatch: (data: any) => request.post(`${API.resource_URL}/exp/saveAll`, data),
    getPermSourceExpUpdateList: (id: number) => request.get(`${API.resource_URL}/exp/update/list?sourceId=${id}`),

    addInterestRateData: (data: any) => request.post(`${API.interestRate_URL}`, data),
    updateInterestRateData: (data: any) => request.put(`${API.interestRate_URL}`, data),
    delInterestRateData: (id: number) => request.delete(`${API.interestRate_URL}?id=${id}`),
    getInterestRateDataList: (current: number, size: number, data: any) => request.post(`${API.interestRate_URL}/page?current=${current}&size=${size}`, data),
    getInterestRateDetail: (id: number) => request.get(`${API.interestRate_URL}/id?id=${id}`),

    getViewRelationSelect: (searchKey: string) => request.get(`${API.resource_URL}/view/relation/select?searchKey=${searchKey}`),

    addStockPoolTypeData: (data: any) => request.post(`${API.stockPoolType_URL}`, data),
    updateStockPoolTypeData: (data: any) => request.put(`${API.stockPoolType_URL}`, data),
    delStockPoolTypeData: (id: number) => request.delete(`${API.stockPoolType_URL}?id=${id}`),
    getStockPoolTypeDataList: (current: number, size: number, data: any) => request.post(`${API.stockPoolType_URL}/page?current=${current}&size=${size}`, data),
    getStockPoolTypeDetail: (id: number) => request.get(`${API.stockPoolType_URL}/id?id=${id}`),

    addControlPoolData: (data: any) => request.post(`${API.controlPool_URL}`, data), //证券池管理
    updateControlPoolData: (data: any) => request.put(`${API.controlPool_URL}`, data),
    delControlPoolTypeData: (id: number) => request.delete(`${API.controlPool_URL}?id=${id}`),
    getControlPoolDataList: (current: number, size: number, data: any) => request.post(`${API.controlPool_URL}/page?current=${current}&size=${size}`, data),
    getControlPoolDetail: (id: number) => request.get(`${API.controlPool_URL}/id?id=${id}`),
    addBatchControlPoolData: (data: any) => request.post(`${API.controlPool_URL}/batch`, data),

    getPermSourceReportPage: (current: number, size: number, data: any) => request.post(`${API.resource_URL}/report/page?current=${current}&size=${size}`, data),
    getPermSourceReportDetail: (id: number) => request.get(`${API.resource_URL}/report/detail?id=${id}`),
    deletePermSourceReport: (id: number) => request.get(`${API.resource_URL}/report/delete?id=${id}`),
    savePermSourceReport: (data: any) => request.post(`${API.resource_URL}/report/save`, data),
    getPermSourceViewMergeInParam: (param: any) => request.post(`${API.resource_URL}/view/merge/in/param`, param),
    getPermSourceReportFindParam: (id: number) => request.get(`${API.resource_URL}/report/find/param?reportId=${id}`),
    exportPermSourceReportData: (data: any) => request.exportFile(`${API.resource_URL}/report/data/export`, data),
    getSoueceOperateLog: (current: number, size: number,param:any) => request.post(`${API.resource_URL}/log/operator?current=${current}&size=${size}`,param),// 操作日志

    executeSourcceViewButtonEvent: (data: any) => request.post(`${API.resource_URL}/view/execute/button/event`, data), //自定义按钮调用接口事件
}
